clear all

load HH_states_gamma_0_GE HH_states_gamma_0_GE
load HH_states_theta_plus10 HH_states_theta_plus10
load HH_states_b1_minus10 HH_states_b1_minus10
load HH_states_b2_minus10 HH_states_b2_minus10
load HH_states_a_minus10 HH_states_a_minus10
load HH_states_alpha_f_plus10 HH_states_alpha_f_plus10
load HH_states_alpha_i_plus10 HH_states_alpha_i_plus10
load HH_states_beta_f_plus10 HH_states_beta_f_plus10
load HH_states_beta_i_plus10 HH_states_beta_i_plus10
load HH_states_lambda_fi_1_plus10 HH_states_lambda_fi_1_plus10
load HH_states_lambda_fi_2_plus10 HH_states_lambda_fi_2_plus10
load HH_states_lambda_if_1_plus10 HH_states_lambda_if_1_plus10
load HH_states_lambda_if_2_plus10 HH_states_lambda_if_2_plus10
load HH_states_lambda_nf_1_plus10 HH_states_lambda_nf_1_plus10
load HH_states_lambda_nf_2_plus10 HH_states_lambda_nf_2_plus10
load HH_states_lambda_ni_1_plus10 HH_states_lambda_ni_1_plus10
load HH_states_lambda_ni_2_plus10 HH_states_lambda_ni_2_plus10
load HH_states_p_1_plus10 HH_states_p_1_plus10
load HH_states_q_1_plus10 HH_states_q_1_plus10
load HH_states_p_2_plus10 HH_states_p_2_plus10
load HH_states_q_2_plus10 HH_states_q_2_plus10
load HH_states_delta_f_1_plus10 HH_states_delta_f_1_plus10
load HH_states_delta_f_2_plus10 HH_states_delta_f_2_plus10
load HH_states_delta_i_1_plus10 HH_states_delta_i_1_plus10
load HH_states_delta_i_2_plus10 HH_states_delta_i_2_plus10

load Agg_stocks_gamma_0_GE Agg_stocks_gamma_0_GE
load Agg_stocks_theta_plus10 Agg_stocks_theta_plus10
load Agg_stocks_b1_minus10 Agg_stocks_b1_minus10
load Agg_stocks_b2_minus10 Agg_stocks_b2_minus10
load Agg_stocks_a_minus10 Agg_stocks_a_minus10
load Agg_stocks_alpha_f_plus10 Agg_stocks_alpha_f_plus10
load Agg_stocks_alpha_i_plus10 Agg_stocks_alpha_i_plus10
load Agg_stocks_beta_f_plus10 Agg_stocks_beta_f_plus10
load Agg_stocks_beta_i_plus10 Agg_stocks_beta_i_plus10
load Agg_stocks_lambda_fi_1_plus10 Agg_stocks_lambda_fi_1_plus10
load Agg_stocks_lambda_fi_2_plus10 Agg_stocks_lambda_fi_2_plus10
load Agg_stocks_lambda_if_1_plus10 Agg_stocks_lambda_if_1_plus10
load Agg_stocks_lambda_if_2_plus10 Agg_stocks_lambda_if_2_plus10
load Agg_stocks_lambda_nf_1_plus10 Agg_stocks_lambda_nf_1_plus10
load Agg_stocks_lambda_nf_2_plus10 Agg_stocks_lambda_nf_2_plus10
load Agg_stocks_lambda_ni_1_plus10 Agg_stocks_lambda_ni_1_plus10
load Agg_stocks_lambda_ni_2_plus10 Agg_stocks_lambda_ni_2_plus10
load Agg_stocks_p_1_plus10 Agg_stocks_p_1_plus10
load Agg_stocks_q_1_plus10 Agg_stocks_q_1_plus10
load Agg_stocks_p_2_plus10 Agg_stocks_p_2_plus10
load Agg_stocks_q_2_plus10 Agg_stocks_q_2_plus10
load Agg_stocks_delta_f_1_plus10 Agg_stocks_delta_f_1_plus10
load Agg_stocks_delta_f_2_plus10 Agg_stocks_delta_f_2_plus10
load Agg_stocks_delta_i_1_plus10 Agg_stocks_delta_i_1_plus10
load Agg_stocks_delta_i_2_plus10 Agg_stocks_delta_i_2_plus10

load Transitions_gamma_0_GE Transitions_gamma_0_GE
load Transitions_theta_plus10 Transitions_theta_plus10
load Transitions_b1_minus10 Transitions_b1_minus10
load Transitions_b2_minus10 Transitions_b2_minus10
load Transitions_a_minus10 Transitions_a_minus10
load Transitions_alpha_f_plus10 Transitions_alpha_f_plus10
load Transitions_alpha_i_plus10 Transitions_alpha_i_plus10
load Transitions_beta_f_plus10 Transitions_beta_f_plus10
load Transitions_beta_i_plus10 Transitions_beta_i_plus10
load Transitions_lambda_fi_1_plus10 Transitions_lambda_fi_1_plus10
load Transitions_lambda_fi_2_plus10 Transitions_lambda_fi_2_plus10
load Transitions_lambda_if_1_plus10 Transitions_lambda_if_1_plus10
load Transitions_lambda_if_2_plus10 Transitions_lambda_if_2_plus10
load Transitions_lambda_nf_1_plus10 Transitions_lambda_nf_1_plus10
load Transitions_lambda_nf_2_plus10 Transitions_lambda_nf_2_plus10
load Transitions_lambda_ni_1_plus10 Transitions_lambda_ni_1_plus10
load Transitions_lambda_ni_2_plus10 Transitions_lambda_ni_2_plus10
load Transitions_p_1_plus10 Transitions_p_1_plus10
load Transitions_q_1_plus10 Transitions_q_1_plus10
load Transitions_p_2_plus10 Transitions_p_2_plus10
load Transitions_q_2_plus10 Transitions_q_2_plus10
load Transitions_delta_f_1_plus10 Transitions_delta_f_1_plus10
load Transitions_delta_f_2_plus10 Transitions_delta_f_2_plus10
load Transitions_delta_i_1_plus10 Transitions_delta_i_1_plus10
load Transitions_delta_i_2_plus10 Transitions_delta_i_2_plus10

load wage_moments_gamma_0_GE_red wage_moments_gamma_0_GE_red
load wage_moments_theta_plus10_red wage_moments_theta_plus10_red
load wage_moments_b1_minus10_red wage_moments_b1_minus10_red
load wage_moments_b2_minus10_red wage_moments_b2_minus10_red
load wage_moments_a_minus10_red wage_moments_a_minus10_red
load wage_moments_alpha_f_plus10_red wage_moments_alpha_f_plus10_red
load wage_moments_alpha_i_plus10_red wage_moments_alpha_i_plus10_red
load wage_moments_beta_f_plus10_red wage_moments_beta_f_plus10_red
load wage_moments_beta_i_plus10_red wage_moments_beta_i_plus10_red
load wage_moments_lambda_fi_1_plus10_red wage_moments_lambda_fi_1_plus10_red
load wage_moments_lambda_fi_2_plus10_red wage_moments_lambda_fi_2_plus10_red
load wage_moments_lambda_if_1_plus10_red wage_moments_lambda_if_1_plus10_red
load wage_moments_lambda_if_2_plus10_red wage_moments_lambda_if_2_plus10_red
load wage_moments_lambda_nf_1_plus10_red wage_moments_lambda_nf_1_plus10_red
load wage_moments_lambda_nf_2_plus10_red wage_moments_lambda_nf_2_plus10_red
load wage_moments_lambda_ni_1_plus10_red wage_moments_lambda_ni_1_plus10_red
load wage_moments_lambda_ni_2_plus10_red wage_moments_lambda_ni_2_plus10_red
load wage_moments_p_1_plus10_red wage_moments_p_1_plus10_red
load wage_moments_q_1_plus10_red wage_moments_q_1_plus10_red
load wage_moments_p_2_plus10_red wage_moments_p_2_plus10_red
load wage_moments_q_2_plus10_red wage_moments_q_2_plus10_red
load wage_moments_delta_f_1_plus10_red wage_moments_delta_f_1_plus10_red
load wage_moments_delta_f_2_plus10_red wage_moments_delta_f_2_plus10_red
load wage_moments_delta_i_1_plus10_red wage_moments_delta_i_1_plus10_red
load wage_moments_delta_i_2_plus10_red wage_moments_delta_i_2_plus10_red

%table stocks variation
Stocks_pp = {'mff'; 'mfi'; 'mfn'; 'mif'; 'mnf'; 'mii'; 'min'; 'mni'; 'mnn'};
Table_stocks_1 = table (Stocks_pp, HH_states_gamma_0_GE,HH_states_theta_plus10,HH_states_b1_minus10,HH_states_b2_minus10,HH_states_a_minus10);
Table_stocks_2 = table (Stocks_pp, HH_states_gamma_0_GE,HH_states_delta_f_1_plus10,HH_states_delta_i_1_plus10,HH_states_lambda_nf_1_plus10,HH_states_lambda_ni_1_plus10,HH_states_lambda_fi_1_plus10,HH_states_lambda_if_1_plus10,HH_states_p_1_plus10,HH_states_q_1_plus10,HH_states_delta_f_2_plus10,HH_states_delta_i_2_plus10,HH_states_lambda_nf_2_plus10,HH_states_lambda_ni_2_plus10,HH_states_lambda_fi_2_plus10,HH_states_lambda_if_2_plus10,HH_states_p_2_plus10,HH_states_q_2_plus10,HH_states_alpha_f_plus10, HH_states_beta_f_plus10,HH_states_alpha_i_plus10,HH_states_beta_i_plus10);
writetable(Table_stocks_1,'Table_stocks_1.xls');
writetable(Table_stocks_2,'Table_stocks_2.xls');

%table Aggregate stocks variation
Agg_stock_pp = {'Household Informality';'Nonemployment head';'Nonemployment Spouse'};
Table_agg_stocks_1 = table (Agg_stock_pp, Agg_stocks_gamma_0_GE,Agg_stocks_theta_plus10,Agg_stocks_b1_minus10,Agg_stocks_b2_minus10,Agg_stocks_a_minus10);
Table_agg_stocks_2 = table (Agg_stock_pp, Agg_stocks_gamma_0_GE,Agg_stocks_delta_f_1_plus10,Agg_stocks_delta_i_1_plus10,Agg_stocks_lambda_nf_1_plus10,Agg_stocks_lambda_ni_1_plus10,Agg_stocks_lambda_fi_1_plus10,Agg_stocks_lambda_if_1_plus10,Agg_stocks_p_1_plus10,Agg_stocks_q_1_plus10,Agg_stocks_delta_f_2_plus10,Agg_stocks_delta_i_2_plus10,Agg_stocks_lambda_nf_2_plus10,Agg_stocks_lambda_ni_2_plus10,Agg_stocks_lambda_fi_2_plus10,Agg_stocks_lambda_if_2_plus10,Agg_stocks_p_2_plus10,Agg_stocks_q_2_plus10,Agg_stocks_alpha_f_plus10, Agg_stocks_beta_f_plus10,Agg_stocks_alpha_i_plus10,Agg_stocks_beta_i_plus10);
writetable(Table_agg_stocks_1,'Table_agg_stocks_1.xls');
writetable(Table_agg_stocks_2,'Table_agg_stocks_2.xls');

%table transitions variation
Transitions_name = {'Unemployed-Formal';'Unemployed-Informal';'Formal-Unemployment'; ...
    'Formal-Informal';'Informal-Unemployed';'Informal-Formal'; 'Unemployed_Informal if other spouse loses formal job'; 'Unemployed_Informal if other spouse loses formal job';'';'';'Unemployed-Formal';'Unemployed-Informal';'Formal-Unemployment'; ...
    'Formal-Informal';'Informal-Unemployed';'Informal-Formal'; 'Unemployed_Informal if other spouse loses formal job'; 'Unemployed_Informal if other spouse loses formal job'};
Table_Transitions_1 = table (Transitions_name, Transitions_gamma_0_GE,Transitions_theta_plus10,Transitions_b1_minus10,Transitions_b2_minus10,Transitions_a_minus10);
Table_Transitions_2 = table (Transitions_name, Transitions_gamma_0_GE,Transitions_delta_f_1_plus10,Transitions_delta_i_1_plus10,Transitions_lambda_nf_1_plus10,Transitions_lambda_ni_1_plus10,Transitions_lambda_fi_1_plus10,Transitions_lambda_if_1_plus10,Transitions_p_1_plus10,Transitions_q_1_plus10,Transitions_delta_f_2_plus10,Transitions_delta_i_2_plus10,Transitions_lambda_nf_2_plus10,Transitions_lambda_ni_2_plus10,Transitions_lambda_fi_2_plus10,Transitions_lambda_if_2_plus10,Transitions_p_2_plus10,Transitions_q_2_plus10,Transitions_alpha_f_plus10, Transitions_beta_f_plus10,Transitions_alpha_i_plus10,Transitions_beta_i_plus10);
writetable(Table_Transitions_1, 'Table_Transitions_1.xls');
writetable(Table_Transitions_2, 'Table_Transitions_2.xls');

%table wage moments
wage_moments_name = {'meanwi_1'; 'meanwf_1'; 'meanwi_2' ; 'meanwf_2'; 'sdwi_1'; 'sdwf_1'; 'sdwi_2'; 'sdwf_2'}
Table_wage_moments_1 = table (wage_moments_name, wage_moments_gamma_0_GE_red,wage_moments_theta_plus10_red,wage_moments_b1_minus10_red,wage_moments_b2_minus10_red,wage_moments_a_minus10_red);
Table_wage_moments_2 = table (wage_moments_name, wage_moments_gamma_0_GE_red,wage_moments_delta_f_1_plus10_red,wage_moments_delta_i_1_plus10_red,wage_moments_lambda_nf_1_plus10_red,wage_moments_lambda_ni_1_plus10_red,wage_moments_lambda_fi_1_plus10_red,wage_moments_lambda_if_1_plus10_red,wage_moments_p_1_plus10_red,wage_moments_q_1_plus10_red,wage_moments_delta_f_2_plus10_red,wage_moments_delta_i_2_plus10_red,wage_moments_lambda_nf_2_plus10_red,wage_moments_lambda_ni_2_plus10_red,wage_moments_lambda_fi_2_plus10_red,wage_moments_lambda_if_2_plus10_red,wage_moments_p_2_plus10_red,wage_moments_q_2_plus10_red,wage_moments_alpha_f_plus10_red, wage_moments_beta_f_plus10_red,wage_moments_alpha_i_plus10_red,wage_moments_beta_i_plus10_red);
writetable(Table_wage_moments_1, 'Table_wage_moments_1.xls');
writetable(Table_wage_moments_2, 'Table_wage_moments_2.xls');


